//package com.jiezhuo.aop;
//
//import com.jiezhuo.cache.RedisCache;
//import com.jiezhuo.entity.ShardingFile;
//import com.jiezhuo.interfaceEntity.Rediskey;
//import com.jiezhuo.utils.ProtocolUtil;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.PostConstruct;
//
//
//@Aspect
//@Component
//public class RedisKeyAop {
//
////    @Autowired
////    private RedisCache redisCache;
//
//    private static RedisKeyAop RedisKeyAop;
//
//    @PostConstruct
//    void init(){
//        RedisKeyAop=this;
////        RedisKeyAop.redisCache = this.redisCache;
//    }
//
//    @Pointcut("execution(public * com.jiezhuo.controller..*(..))")
//    public void toRedis() {
//
//    }
//
//
//
//    @Before("toRedis() && @annotation(sv)")
//    public void demoBefore(JoinPoint joinPoint, Rediskey sv) {
//        Object[] args = joinPoint.getArgs();
//        System.out.println((ShardingFile)args[0]);
//    }
//
//    @After("toRedis() && @annotation(sv)")
//    public void demoAfter(JoinPoint joinPoint, Rediskey sv) {
//        System.out.println("释放锁");
//
////        redisCache.deleteObject(sv.redisKey());
//    }
//
//    @AfterThrowing("toRedis() && @annotation(sv)")
//    public void demoAfterThrowing(JoinPoint joinPoint, Rediskey sv) {
//        //....
//    }
//
//    @Around("toRedis() && @annotation(sv)")
//    public Object demoAround(ProceedingJoinPoint pjp, Rediskey sv) throws Throwable {
////        while (true){
////            Thread.sleep(200);
////            if(redisCache.getCacheObject(sv.redisKey())){
////                break;
////            }
////        }
////
////        redisCache.setCacheObject(sv.redisKey(),"1",2, TimeUnit.SECONDS);
////        Object[] args = pjp.getArgs();
////        System.out.println("args"+args[0]);
//        return pjp.proceed();
//    }
//}
